import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
// 引入reset文件 
import "@/scss/reset.scss"
// 引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入router组件
import { router } from "@/router/index"
// 引入icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// 引入全局组件
import globalTop from '@/components/global/global_top/index.vue'
import globalBottom from '@/components/global/global_bottom/index.vue'
import login from '@/components/login/index.vue'
//引入路由鉴权的文件
import './permisstion'
const app = createApp(App)
export const pinia = createPinia()

app.use(pinia)

// 注册为全局组件
app.component('globalTop', globalTop);
app.component('globalBottom', globalBottom)
app.component('login',login)
// 注册全部组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册路由
app.use(router)
app.use(ElementPlus, {
  locale: zhCn
})


app.mount('#app')
